//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.meet.exception;


public enum CommonErrors {
    SUCCESS("0000", "成功"),
    INVALID_APPID("0001", "AppID不合法"),
    SIGNATURE_VERIFY_FAIL("0002", "签名验证失败"),
    UNAUTHORIZED("0003", "没有权限"),
    INVALID_PARAM("0004", "参数错误"),
    TOKEN_VERIFY_FAIL("0005", "非法token或已失效"),
    SERVICE_NOT_EXIST("0006", "服务不存在"),
    SERVICE_UNAVAILABLE("0007", "服务暂不可用"),
    HTTP_CONTENT_TYPE_UNEXPECTED("0010", "Content-Type 不符合预期"),
    UNDEFINED("9999", "系统错误");

    private String code;
    private String msg;

    public static CommonErrors codeOf(String code) {
        for(CommonErrors error : values()) {
            if (error.code.equals(code)) {
                return error;
            }
        }

        throw new IllegalArgumentException("No enum constant com.bwton.core.web.CommonErrors." + code);
    }

    private CommonErrors(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public String toString() {
        return "Errors{code='" + this.code + '\'' + ", msg='" + this.msg + '\'' + "} " + super.toString();
    }
}
